Carbon


RemoveIndexedCollectionItem

Header: Collections.h Carbon status: Supported

Removes an item from a collection given the item’s index.

OSErr RemoveIndexedCollectionItem (
    Collection c, 
    SInt32 index
);
c

A reference to the collection object from which you want to remove the item. The behavior of this function is undefined if you do not provide a reference to a valid collection object.

index

The collection index of the item you want to remove.

function result

A result code. If the c collection does not contain an item whose collection index matches the values in the index parameter, this function returns a collectionIndexRangeErr result code.

DISCUSSION

The RemoveIndexedCollectionItem function removes the item specified by the index parameter from the collection referenced by the c parameter. This function removes the specified item even if its lock attribute is set.

To remove a collection item using the item’s tag and ID (rather than the item’s index), use the RemoveCollectionItem function.

To replace an item in a collection, use the function ReplaceIndexedCollectionItem.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)